$(function(){
               $("#uploadify").uploadify({
                'swf':pu+'/upload/uploadify.swf',  
                'uploader':url+"/upload",
                'fileTypeExts':"*.jpg;*.jpeg;*.gif;*.png",
                'buttonImage':pu+'/upload/upload2.png',
                'onUploadSuccess': function (file,data, response) {
                         var str = "<tr><th></th><td><img src='"+data+"' class='upimg'/></td></tr>";
                         $('.logo').after(str);
                },
                'onInit': function (){                        //载入时触发，将flash设置到最小
                    $("#uploadify-queue").hide();
                } 
            })  
	 $('.btn').click(function(){
	 		var name = $('input[name=name]').val();
	 		if(name==''){
	 			mesa('品牌名不能为空');
	 			return false;
	 		}
	 		var host  = $('input[name=host]:checked').val();
	 		var logo = $('.upimg').attr('src');
	 		$.post(url+'/add',{'name':name,'host':host,'logo':logo},function(data){
	 					if(data.num){
	 						mesa(data.mesa);
	 						location.href=url+'/index';
	 					}else{
	 						mesa(data.mesa);
	 						return false;
	 					}
	 		},'json')
})
	})